import { Redirect } from 'umi'
import React from 'react'
import {getToken} from '@/utils/index'
const AuthWrapper:React.FC=function (props) {
  const  isLogin  = !!getToken()
  if (isLogin) {
    return <>{ props.children }</>;
  } else {
    return <Redirect to="/login" />;
  }
}
export default AuthWrapper